package com.guli.gulimall.member.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/person")
@RefreshScope
public class PeronsController {

    //使用value注解进行取值
    @Value("${person.name}")//spel表达式
    private String name;

    @Value("${person.age}")//spel表达式
    private Integer age;

    @RequestMapping("/getMsg")
    public String getMsg(){
        return name+age;
    }
}
